package com.xingfly.model;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 提醒对象
 * Created by SuperS on 2016/12/7.
 */
@Entity
@Table(name = "xf_notification")
public class Notification extends BaseModel {
    //提醒类型
    private int notificationType;
    //通告对象的ID,比如评论的ID
    private Long notificationId;
    //被通告的对象
    @OneToOne
    @JoinColumn(name = "event_id")
    private Event event;
    //被通告的用户
    @OneToOne
    @JoinColumn(name = "notified_id")
    private User notifiedUser;
    //通告者
    @OneToOne
    @JoinColumn(name = "notifier_id")
    private User notifier;
    //状态 0未读 1已读
    private int status;

    public Notification() {
    }

    public Notification(int notificationType, Long notificationId, Event event, User notifiedUser, User notifier, int status) {
        this.notificationType = notificationType;
        this.notificationId = notificationId;
        this.event = event;
        this.notifiedUser = notifiedUser;
        this.notifier = notifier;
        this.status = status;
    }

    public int getNotificationType() {
        return notificationType;
    }

    public void setNotificationType(int notificationType) {
        this.notificationType = notificationType;
    }

    public Long getNotificationId() {
        return notificationId;
    }

    public void setNotificationId(Long notificationId) {
        this.notificationId = notificationId;
    }

    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public User getNotifiedUser() {
        return notifiedUser;
    }

    public void setNotifiedUser(User notifiedUser) {
        this.notifiedUser = notifiedUser;
    }

    public User getNotifier() {
        return notifier;
    }

    public void setNotifier(User notifier) {
        this.notifier = notifier;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
}
